package com.xyw.code.platform.common.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 岗位管理
 * </p>
 *
 * @author xyw
 * @since 2020-02-17
 */
@TableName("sys_job")
@Data
public class SysJob extends Model<SysJob> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(type = IdType.ID_WORKER_STR)
    private String id;
    /**
     * 岗位名称
     */
    @TableField("job_name")
    private String jobName;
    /**
     * 部门id
     */
    @TableField("dept_id")
    private String deptId;
    /**
     * 排序
     */
    private Integer sort;
    /**
     *  是否删除  -1：已删除  0：正常
     */
    @TableField("del_flag")
    private Integer delFlag;
    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;
    /**
     * 更新时间
     */
    @TableField("update_time")
    private Date updateTime;

    /**
     * 非数据库字段
     * 所属部门
     */
    @TableField(exist = false)
    private String deptName;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "SysJob{" +
        ", id=" + id +
        ", jobName=" + jobName +
        ", deptId=" + deptId +
        ", sort=" + sort +
        ", delFlag=" + delFlag +
        ", createTime=" + createTime +
        ", updateTime=" + updateTime +
        "}";
    }
}
